use super::solution::Solution;
impl Solution {
    pub fn partition_array(mut nums: Vec<i32>, k: i32) -> i32 {
        nums.sort();
        let mut ans = 1;
        let mut l = nums[0];
        for item in nums {
            if l + k < item {
                l = item;
                ans += 1
            }
        }
        ans
    }
}
